import { goto } from "$app/navigation";

export const routeTo = (url: string, replaceState = false) => {
  goto(url, { replaceState });
};

export const goBack = (defaultRoute = "/") => {
  const ref = document.referrer;
  goto(ref.length > 0 ? ref : defaultRoute);
};
